package com.jt.mapper;

import com.jt.pojo.User;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
//@Mapper //将Mapper接口交给Spring容器管理.
public interface UserMapper {

    List<User> findAll();
    @Select("select * from demo_user where id =#{id}")
    User findByid(Integer id);

    List<User> findUserByAS(User user);
    @Update("update demo_user set age = 8000 where id =#{id} and name =#{name} " +
        "and age =#{age} and sex =#{sex}")
    void updateById(User user);
@Select("select * from demo_user where name like \"%\"#{name}\"%\"")
    List<User> findUserByLike(String name);

    List<User> findUserByIds(Integer[] ids);
    void saveUser(User user);



    @Delete("delete from demo_user where id=#{id}")
    void deleteUser(User user);
}
